package router

import (
	"github.com/gin-gonic/gin"
	"yunwei/go_api/application/api"
	"yunwei/go_api/application/middleware"
	"yunwei/go_api/application/utils"
)

func InitCmdRouter(Router *gin.RouterGroup) {
	/**
	指令模板相关的路由组
	*/
	cmdRouter := Router.Group("cmd")

	{
		// 指令模板类别-添加
		utils.Register(cmdRouter, []string{"POST"}, "category", api.CmdCategoryCreate)
		// 指令模板类别-列表
		utils.Register(cmdRouter, []string{"GET"}, "category", api.CmdCategoryList)
		// 指令模板-添加
		utils.Register(cmdRouter, []string{"POST"}, "", api.CmdCreate)
		// 指令模板-列表
		utils.Register(cmdRouter, []string{"GET"}, "", api.CmdList)
		// 指令模板-信息
		utils.Register(cmdRouter, []string{"GET"}, ":id/info", middleware.JWTAuthorization(), api.CmdInfo)
	}
}
